/// ### 调整数据
/// #### [data] List|必填|数据源
Map formatData(List data) {
  String txt = "",
      province = "",
      city = "",
      area = "",
      street = "",
      areaId = "";
  int level;

  // 遍历data，将需要的数据进行存储
  for (int i = 0; i < data.length; i++) {
    txt += data[i]["text"];
    level = data[i]["level"];
    areaId = data[i]["code"];
    province = i == 0
        ? province == ""
            ? data[i]["code"]
            : province
        : province;
    city = i == 1
        ? city == ""
            ? data[i]["code"]
            : city
        : city;
    area = i == 2
        ? area == ""
            ? data[i]["code"]
            : area
        : area;
    street = i == 3
        ? street == ""
            ? data[i]["code"]
            : street
        : street;
  }

  // 返回调整后的数据
  return {
    "txt": txt,
    "province": province,
    "city": city,
    "area": area,
    "street": street,
    "level": level,
    "areaId": areaId,
    "page": 1
  };
}
